/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farent.solutions.plugins.stripes.hyperstripes.utils;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * @author user
 */
public class ServletUtils {

    public static String createApplicationUrl(HttpServletRequest request) {
        StringBuilder urlBuilder = new StringBuilder();
        urlBuilder.append(
                request.getScheme())
                .append("://")
                .append("localhost")
                .append(":").
                append(request.getLocalPort()).
                append(request.getContextPath());
        urlBuilder.trimToSize();
        return urlBuilder.toString();

    }
}
